using UnityEngine.EventSystems;

public class UICraftSlot : UIItemSlot
{

    protected override void Awake()
    {
        base.Awake();
    }
    public void SetupCraftSlot(ItemDataEquiment _data)
    {
        if (_data == null)
        {
            return;
        }
        item.data = _data;
        ItemImage.sprite = _data.icon;
        itemText.text = _data.itemName;

        if (itemText.text.Length > 12)
        {
            itemText.fontSize = itemText.fontSize * .7f;
        } else
        {
            itemText.fontSize = 24;
        }
    }
    public override void OnPointerDown(PointerEventData eventData)
    {
        ui.craftWindow.SetupCraftWindow(item.data as ItemDataEquiment);
    }
}
